<template>
    <div>
      <div style="width: 100%;height: 60px">
        <router-link :to="{path:'/questionType',}">
          <el-button type="primary" icon="el-icon-back" style="float: left">返回题型列表</el-button>
        </router-link>
      </div>
      <div style="height: 60px">{{questionType.questionTypeName}}</div>
      <div>
        <el-table :data="questionTypeModeList"
                  border
                  tooltip-effect="dark"
                  style="width:900px;margin: 0 auto;">
          <el-table-column label="模块名" width="740px">
            <template slot-scope="questionTypeModeList">{{questionTypeModeList.row.modeName}}</template>
          </el-table-column>
          <el-table-column label="模块类型" width="150px">
            <template slot-scope="questionTypeModeList">{{questionTypeModeList.row.modeType}}</template>
          </el-table-column>
        </el-table>
      </div>
    </div>
</template>

<script>
  import qs from 'qs'
    export default {
        name: "ShowQuestionType",
      data(){
          return{
            questionType:{
              id:'',
              questionTypeName:''
            },
            questionTypeModeList:[],
          }
      },
      created() {
        this.getQuestionType()
      },
      methods:{
          getQuestionType(){
            this.questionType.id=this.$route.query.id
            this.$axios.get('/questionType/getQuestionType',{
              params: {
                questionTypeId:this.questionType.id
              }
            })
              .then(res=>{
                this.questionType.questionTypeName = res.data.data.questionTypeName;
                this.questionTypeModeList = res.data.data.modes;
              })
              .catch(err=>{
                this.$message({
                  message:'获取数据错误',
                  type: 'error',
                  duration: 3000
                })
              })
          }
      }
    }
</script>

<style scoped>

</style>
